package com.myapp.struts.action;

import com.myapp.hibernate.model.Combate;
import com.myapp.hibernate.util.CombateUtil;
import com.myapp.struts.form.CombatesForm;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class BorrarCombateAction extends org.apache.struts.action.Action {

    private static final String SUCCESS = "success";

    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
            throws Exception {
        CombatesForm formulario = (CombatesForm) form;
        CombateUtil combateUtil = new CombateUtil();
        
        Combate c = combateUtil.obtenerCombate(formulario.getIdCombate());
        combateUtil.borrar(c);
//        String salida;
//        PrintWriter out = response.getWriter();
//        out.println(salida);
//        out.flush();
        return null;
    }
}
